package com.tuhao.www.util;

import java.util.Date;

import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.support.ConfigurableWebBindingInitializer;
import org.springframework.web.context.request.WebRequest;

/**
 * 
 * 描述：spring 日期，字符转换
 * 
 * 说明:
 */
public class SpringWebBinding extends ConfigurableWebBindingInitializer {

	public void initBinder(WebDataBinder binder, WebRequest request) {
		super.initBinder(binder, request);
		// 2. 自定义的PropertyEditorSupport
		binder.registerCustomEditor(Date.class, new DateConvertEditor());
		binder.registerCustomEditor(String.class, new StringConvertEditor());

	}

}
